﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：ISettingStore.cs
// 功能描述：TongTongMall
// 
// Create User：jym 2017/02/09
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TongTongMall.Configuration
{
    public interface ISettingStore
    {
        /// <summary>
        /// 获取配置信息
        /// </summary>
        /// <param name="tenantId"></param>
        /// <param name="userId"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        Task<SettingInfo> GetSettingOrNullAsync(long? tenantId, long? userId, string key);

        /// <summary>
        /// 删除配置信息
        /// </summary>
        /// <param name="setting"></param>
        /// <returns></returns>
        Task DeleteAsync(SettingInfo setting);

        /// <summary>
        /// 创建配置信息
        /// </summary>
        /// <param name="setting"></param>
        /// <returns></returns>
        Task CreateAsync(SettingInfo setting);

        /// <summary>
        /// 更新配置信息
        /// </summary>
        /// <param name="setting"></param>
        /// <returns></returns>
        Task UpdateAsync(SettingInfo setting);

        /// <summary>
        /// 获取全部缓存配置对象
        /// </summary>
        /// <param name="tenantId"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<List<SettingInfo>> GetAllListAsync(long? tenantId, long? userId);
    }
}
